import java.io.*;


public class Mytest {

	public static void main (String[] args) {		
		try {
			String text = "";
			int number;
			int bnumber = 0;
			
			BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));
			
			System.out.println("Enter a text:");
			text = stdin.readLine();
			System.out.println("The text is: " + text);
			
			do {
				try{
					System.out.println("Enter a number");
					number = Integer.parseInt(stdin.readLine());
					System.out.println("The number is:" + number);
					bnumber = 1;
				} catch (NumberFormatException nfe) {
					System.out.println("The entered number is not valid. You need enter a valid number.");
				}				
			} while (bnumber == 0);
		}
		catch(IOException ioe) {}
	}
}